package com.shakespace.artofandroid.temp

import okhttp3.OkHttpClient
import retrofit2.Retrofit
import java.time.Duration
import java.util.concurrent.Callable
import java.util.concurrent.TimeUnit

object Api {

    val okHttpClient  = OkHttpClient.Builder()
        .readTimeout(60000,TimeUnit.MILLISECONDS)
        .build()

    val retrofit = Retrofit.Builder()
        .baseUrl("https://www.baidu.com")
        .client(okHttpClient)
        .build()

    fun getService (){

        val create = retrofit.create(HomeService::class.java)
        val callHomeApi = create.callHomeApi()
        val call = callHomeApi.call()
        call.length
    }
}

interface HomeService {

    fun callHomeApi():Callable<String>

}
